1 using System.Collections;
2 using
System.Collections.Generic;
3 using
UnityEngine;
4 using
UnityEngine.SceneManagement;
5
6 public
class LevelManager : MonoBehaviour {
7    
8     
9     
public void LoadLevel(string name){
10         Debug.Log(
"Level load requested for: " + name);
11         Brick.breakableCount =
0;
12        SceneManager.LoadScene(name);
13     }
14
15     
public void QuitRequest(){
16         Debug.Log(
"I want to Quit");
17         Application.Quit();
18     }
19
20     
public void BackRequest()
21     {
22         Debug.Log(
"I want to go back");
23     }
24
25     
public void LoadNextLevel()
26     {
27         Brick.breakableCount =
0;
28         SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex +
1);
29     }
30
31     
public void BrickDestroyed()
32     {
33         
if (Brick.breakableCount <= 0)
34         {
35             LoadNextLevel();
36         }
37     }
38 }


Gõ tìm kiếm nhanh...